﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="BySoft.Web.Site.SysManage.UserList"
    MasterPageFile="~/MastePage/SubEmptyMaster.Master" %>

<%@ Register Assembly="OneSoft.Web" Namespace="OneSoft.Web.UI.WebControls" TagPrefix="asp" %>
<%@ Register Assembly="BySoft.Web.Controls" Namespace="BySoft.Web.Controls" TagPrefix="cc1" %>
<asp:Content ContentPlaceHolderID="EmptyMasteCPH" runat="server" ID="cphContent">
    <h1 class="tit">
        系统管理 >> 用户管理</h1>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <%--查询条件--%>
            <div class="searchTable">
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <th class="left2">
                            账号：
                        </th>
                        <td class="right2">
                            <asp:TextBox ID="txtUserID" CssClass="text ui-widget-content ui-corner-all" runat="server"> </asp:TextBox>
                        </td>
                        <th class="left2">
                            姓名：
                        </th>
                        <td class="right2">
                            <asp:TextBox ID="txtUserName" runat="server" CssClass="text ui-widget-content ui-corner-all"> </asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th class="left2">
                            状态：
                        </th>
                        <td class="right2">
                            <asp:DropDownList ID="ddlStatus" CssClass="text ui-widget-content ui-corner-all ddlwidth" runat="server">
                                <asp:ListItem Value="1">有效</asp:ListItem>
                                <asp:ListItem Value="0">无效</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <th class="left2">
                        </th>
                        <td class="right2">
                        </td>
                    </tr>
                </table>
                <div class="btnStylef">
                    <label class="btnStylec png_bg">
                        <input value="新增" type="button" id="Button1" onclick="window.location='/SysManage/UserAdd.aspx'"
                            style="width: 60px;" />
                    </label>
                    <label class="btnStyleb png_bg">
                        <asp:Button Text="查询" runat="server" ID="Button2" OnClick="btnSearch_Click" Width="60px" />
                    </label>
                </div>
            </div>
            <%--列表--%>
            <div class="tableStyle">
                <asp:SGridView runat="server" ID="grdResult" Width="100%" ShowActionToolBar="false"
                    AutoGenerateColumns="false" AllowCascade="false" OnRowDataBound="grdResult_RowDataBound"
                    OnRowCommand="grdResult_RowCommand" DataKeyNames="STATUS">
                    <Columns>
                        <asp:BoundField DataField="USERID" HeaderText="账号" HeaderStyle-Width="30%" ItemStyle-Width="20%" />
                        <asp:BoundField DataField="USERNAME" HeaderText="姓名" HeaderStyle-Width="30%" ItemStyle-Width="20%" />
                        <asp:BoundField DataField="STATUS" HeaderText="状态" HeaderStyle-Width="10%" ItemStyle-Width="10%" />
                        <asp:BoundField DataField="DepartmentID" HeaderText="部门" HeaderStyle-Width="10%" ItemStyle-Width="10%" />
                        <asp:BoundField DataField="IsGeneral" HeaderText="是否部门经理" HeaderStyle-Width="10%" ItemStyle-Width="10%"/>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                操作</HeaderTemplate>
                            <HeaderStyle Width="20%" />
                            <ItemStyle Width="20%" />
                            <ItemTemplate>
                                <a href="../SysManage/UserEdit.aspx?USER_ID=<%#SetFormat(Eval("UserID")) %>">
                                    <img alt="编辑" src="../../App_Themes/Common_CSS/images/GridEdit.gif" /></a>
                                <asp:ImageButton ID="lbtnChangeStauts" runat="server" CommandArgument='<%#Eval("USERID") %>'
                                    CommandName="ChangeStauts"></asp:ImageButton>
                                <asp:LinkButton ID="lbtnResetPwd" runat="server" CommandArgument='<%#Eval("USERID") %>'
                                    CommandName="ResetPwd" ForeColor="#0033CC">密码重置</asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderStyle CssClass="delbtn" />
                            <HeaderTemplate>
                                删除</HeaderTemplate>
                            <HeaderStyle Width="10%" />
                            <ItemStyle Width="10%" />
                            <ItemTemplate>
                                <asp:ImageButton ImageUrl="~/App_Themes/Common_CSS/images/delete_small.gif" runat="server"
                                    ID="ibtnDel" />
                                <asp:Button ID="btnDel" runat="server" CssClass="Hidden" CommandArgument='<%#Eval("USERID") %>'
                                    CommandName="del" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:SGridView>
                <div style="padding-top: 5px" align="right">
                    <cc1:PagingControl ID="pcData" runat="server" OnPageIndexClick="pcData_PageIndexClick" />
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
